package com.weigee.ktv.model

import android.util.Log
import com.weigee.ktv.model.enums.WeigeeHost
import retrofit2.Retrofit


/**
 * Created by linde on 2017/5/27.
 * Api
 */
class WeigeeApi private constructor()
{
    val service: WeigeeService

    init
    {
        Log.e("TTTTTTTTTT", WeigeeHost.TEST_URL_HEADER.url)
        val retrofit = Retrofit.Builder()
                .baseUrl(WeigeeHost.TEST_URL_HEADER.url)
                .build()
        service = retrofit.create(WeigeeService::class.java)
    }

    companion object
    {
        private var instance: WeigeeApi? = null
        val INSTANCE: WeigeeApi
            get()
            {
                if (instance == null)
                {
                    synchronized(WeigeeApi::class.java)
                    {
                        if (instance == null)
                        {
                            instance = WeigeeApi()
                        }
                    }
                }
                return instance as WeigeeApi
            }
    }
}